<?php

namespace app\admin\model;

use app\admin\model\CommonModel;

class BatOrderModel extends CommonModel
{
    //0待开奖 ，1未中，2已中 3作废
    const STATUS_AWAIT        = 0;
    const STATUS_NOT_WINNER   = 1;
    const STATUS_WINNER       = 2;
    const STATUS_CANCELLATION = 3;

    public static $winStatus = [
        self::STATUS_NOT_WINNER   => '未中奖',
        self::STATUS_WINNER       => '已中奖',
        self::STATUS_CANCELLATION => '作废',
    ];

    public function batMatch()
    {
        return $this->belongsTo('BatMatchModel', 'bat_id');
    }

    public function getCreateTimeAttr($vaule)
    {
        return date('Y-m-d H:i:s', $vaule);

    }
}
